<template>
  <div>
    <div class="container">
      <div class="heading">
        <a href="#">2048</a>
        <div class="score-container">
          <div class="game-score">
            {{score}}
          </div>
          <div class="game-best">
            {{best}}
          </div>
        </div>
      </div>
      <div class="game-intro">
        <p>介绍</p>
        <a href="#">new game</a>
      </div>
      <div class="game-container">
        <div class="grid-container">
          <div class="grid-row" v-for="item in 4"
               :style="{'margin-bottom':item===4?'0px':''}"
               :key="item">
            <div class="grid-cell" v-for="det in 4"
                 :style="{'margin-right':det===4?'0px':''}"
                 :key="det"></div>
          </div>
        </div>
      </div>
    </div>

  </div>
</template>

<script>
  export default {
    name: "tzfe",
    data(){
      return {
        score:0,
        best:0,
      }
    }
  }
</script>

<style scoped>

  @media screen and (max-height: 768px) and (min-width: 481px) {
    .container{
      width: 450px;
    }
    .game-container{
      width: 426px;
      height: 426px;
      padding: 12px;
    }
    .grid-row{
      margin-bottom: 12px;
      height: 97.5px;
    }
    .grid-cell {
      width: 97.5px;
      height: 97.5px;
      margin-right: 12px;
    }
  }


  @media screen and (max-width: 520px){
    .container{
      width: 280px;
    }

    .game-container{
      width: 260px;
      height: 260px;
      padding: 10px;
    }
    .grid-row{
      margin-bottom: 10px;
      height: 57.5px;
    }
    .grid-cell {
      width: 57.5px;
      height: 57.5px;
      margin-right: 10px;
    }
  }
  /*小屏结束*/



  .container{
    margin: 0 auto;
  }
  .game-container{
    background-color: #bbada0;
    border-radius: 6px;
  }


  .game-best,.game-score{
    position: relative;
    display: inline-block;
    text-align: center;
    background: #bbada0;
    padding: 15px 25px;
    font-size: 25px;
    height: 25px;
    line-height: 47px;
    font-weight: 700;
    border-radius: 3px;
    color: #fff;
    margin-top: 8px;
  }
  .game-best{
    margin-left: 8px;
  }
  .game-best::after{
    content: 'best';
    position: absolute;
    width: 100%;
    top: 10px;
    left: 0;
    text-transform: uppercase;
    font-size: 13px;
    line-height: 13px;
    text-align: center;
    color: #eee4da;
  }
  .game-score::after{
    content: 'score';
    position: absolute;
    width: 100%;
    top: 10px;
    left: 0;
    text-transform: uppercase;
    font-size: 13px;
    line-height: 13px;
    text-align: center;
    color: #eee4da;
  }

  .score-container{
    float: right;
  }

  .grid-cell{
    float: left;
    border-radius: 3px;
    background: rgba(238,228,218,.35);
    display: inline-block;
  }

  .heading{
    height: 65px;
  }
  .game-intro{
    margin: 20px 0;
  }

</style>
